package ms.unicorn.dsl.analysis.impl;

import java.util.ArrayList;
import java.util.List;

import ms.unicorn.dsl.analysis.ConversionService;
import ms.unicorn.dsl.analysis.IConversionScheme;

public class ConversionServiceImpl implements ConversionService {

	private List<IConversionScheme> schemes = new ArrayList<IConversionScheme>();
	
	@Override
	public void registerConversionScheme(IConversionScheme scheme) {
		schemes.add(scheme);
	}

	@Override
	public IConversionScheme getConversionScheme(String language, String scheme) {
		for (IConversionScheme s: schemes)
			if (s.isConverterFor(language, scheme)) return s;
		return null;
	}

}
